import java.util.*;

/**
 * @Auther: yuanjianpeng
 * @Date: 2019/2/24 14:25
 * @Description:
 */
public class LoadClassOrderTest {

    static String A = "a";
    String B = "b";
    static {
        System.out.println("C");
    }
    {
        System.out.println("D");
    }
    static void A() {
        System.out.println("e");
    }
    void B() {
        System.out.println("f");
    }

    public LoadClassOrderTest(){
        System.out.println("h");
    }

    public LoadClassOrderTest(String b) {
        System.out.println(this.B);
        B = b;
    }

    public void printArray(int[] arrays){
        //目标数组进行排序
        Arrays.sort(arrays);
        //目标数组去重
        List<Integer> arraysList = new ArrayList<Integer>();
        for (int str : arrays) {
            if (!arraysList.contains(str)) {
                arraysList.add(str);
            }
        }
        //输出第11大的数
        System.out.println("arrays中最大的数为："+arraysList.get(arraysList.size()-12));
        //得到前10个大数的集合
        List<Integer> arraysPreTen = arraysList.subList(arraysList.size()-10,arraysList.size());
        //原数组中去掉这前10个大数
        Integer[] arraysTmp = new Integer[0];
        List<Integer> preList = Arrays.asList(arraysTmp);


        Set<Integer> set = new HashSet<Integer>();
        for(int i : arrays){
            set.add(i);
        }
        Integer[] arraysTmp = new Integer[0];
        set.toArray(arraysTmp);
        Arrays.sort(arraysTmp);
        System.out.println("arrays中最大的数为："+arraysTmp[arraysTmp.length-12]);
        int[] subArray = new int[0];
        System.arraycopy(arraysTmp,arraysTmp.length-10, subArray, 0, 10);
        Integer[] arraysTmp2 = substract(arrays,subArray);
        Arrays.sort(arraysTmp2);
        int middleNum = 0;
        if(arraysTmp2.length%2!=0){
            middleNum = arraysTmp2[arraysTmp2.length/2];
        }else{
            middleNum = (arraysTmp2[arraysTmp2.length/2]+arraysTmp2[arraysTmp2.length/2-1])/2;
        }
        System.out.println("arrays除前10个大数外的中位数为："+middleNum);
    }

    public Integer[] substract(int[] arr1, int[] arr2) {
        List<Integer> list = new ArrayList<>();
        for (int str : arr1) {
            if (!list.contains(str)) {
                list.add(str);
            }
        }
        for (int str : arr2) {
            if (list.contains(str)) {
                list.remove(new Integer(str));
            }
        }
        Integer[] result = new Integer[list.size()];
        return list.toArray(result);
    }

    public static void main(String[] args) {
//        LoadClassOrderTest s = new LoadClassOrderTest("g");
//        System.out.println(s.B);

//        int a = 1;
//        Integer b = 1;
//        System.out.println(a == b);
//        Integer c = 1;
//        System.out.println(b == c);
//        Integer d = new Integer("1");
//        System.out.println(b == d);
//        Integer e = b;
//        System.out.println(b == e);

//        String a = "a";
//        String b = "a";
//        System.out.println(a == b);
//        String c = new String("a");
//        System.out.println(b == c);
//        String d = b;
//        System.out.println(b == d);

//        int[] n = new int[20];
////        for(int i:n){
////            n[i]=new Random().nextInt();
////        }
////        System.out.println(Arrays.toString(n));
////        LoadClassOrderTest s = new LoadClassOrderTest();
////        s.printArray(n);

        int[] n = {1,3,6,7,5,5,7,2};
//        Arrays.sort(n);
//        int m[] = new int[3];
//        System.arraycopy(n,n.length-3, m, 0, 3);
//        System.out.println(Arrays.toString(n));
//        System.out.println(Arrays.toString(m));

        int[] arrays = new int[100];
        Scanner sc = new Scanner(System.in);
        for(int i: arrays){
            i = sc.nextInt();
        }
        LoadClassOrderTest s = new LoadClassOrderTest();
        s.printArray(arrays);

//        int[] m = {5,6,7};
//        LoadClassOrderTest s = new LoadClassOrderTest();
//        System.out.println(Arrays.toString(s.substract(n,m)));
    }

}
